home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-12-03 | 2.2 KB | 114 lines |
- /*
- A basic extension of the java.awt.Frame class
- */
-
- import java.awt.*;
-
- public class Plasma extends Frame {
- void close_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Stop the plasma animation
- {
- plasma1.stopPlasma();
- }
- //}}
-
- //{{CONNECTION
- // Hide the Frame
- hide();
- //}}
- }
-
- void start_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Start the plasma animation
- {
- plasma1.startPlasma();
- }
- //}}
- }
-
- void About_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Stop the plasma animation
- {
- plasma1.stopPlasma();
- }
- //}}
- }
-
-
- public Plasma() {
-
- //{{INIT_CONTROLS
- setLayout(null);
- addNotify();
- resize(insets().left + insets().right + 478,insets().top + insets().bottom + 107);
- setBackground(new Color(65535));
- Stop = new java.awt.Button("Stop the Plasma");
- Stop.reshape(insets().left + 172,insets().top + 72,126,24);
- add(Stop);
- start = new java.awt.Button("Re-Start the Plasma");
- start.reshape(insets().left + 333,insets().top + 72,126,24);
- add(start);
- close = new java.awt.Button("Close");
- close.reshape(insets().left + 11,insets().top + 72,126,24);
- add(close);
- plasma1 = new symantec.itools.multimedia.Plasma();
- plasma1.reshape(insets().left + -2,insets().top + 1,479,107);
- add(plasma1);
- plasma1.setPreviewMode(false);
- setTitle("Untitled");
- //}}
-
- //{{INIT_MENUS
- //}}
- }
-
- public Plasma(String title) {
- this();
- setTitle(title);
- }
-
- public synchronized void show() {
- move(50, 50);
- super.show();
- }
-
- public boolean handleEvent(Event event) {
- if (event.id == Event.WINDOW_DESTROY) {
- hide(); // hide the Frame
- return true;
- }
- if (event.target == Stop && event.id == Event.ACTION_EVENT) {
- About_Clicked(event);
- return true;
- }
- if (event.target == start && event.id == Event.ACTION_EVENT) {
- start_Clicked(event);
- return true;
- }
- if (event.target == close && event.id == Event.ACTION_EVENT) {
- close_Clicked(event);
- return true;
- }
- return super.handleEvent(event);
- }
-
- //{{DECLARE_CONTROLS
- java.awt.Button Stop;
- java.awt.Button start;
- java.awt.Button close;
- symantec.itools.multimedia.Plasma plasma1;
- //}}
-
- //{{DECLARE_MENUS
- //}}
- }
-